package main

import "fmt"

func main() {
	//定义字符串
	var str = "hello golang你好"
	for i := 0; i < len(str); i++ {
		fmt.Printf("%c", str[i])
	}
	//for range 输出的i是字节索引 中文占三个字节 3字节的UTF-8编码
	for i, s := range str {
		fmt.Printf("%d, %c\n", i, s)
	}
}
